
package com.bosssoft.boss_exam_db.service.base;

import org.springframework.stereotype.Service;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * 通用接口
 */
@Service
public interface BaseService<T> {

    T selectByKey(Object key) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    int save(T entity);

    int saveNotNull(T entity);

    int delete(Object key);

    int deleteByExample(Object example);

    int updateAll(T entity);

    int updateNotNull(T entity);

    List<T> selectByExample(Object example);

    int selectCountByExample(Object example);

    int deleteForLogic(T entity) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;

    int deleteForLogicByExample(T entity,Object example)throws NoSuchMethodException, InvocationTargetException, IllegalAccessException;
    //TODO 其他...
}
